<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>图片处理</title>
    <script type="text/javascript">
        function getParameter(val) {
            var uri = decodeURI(window.location.search);
            var re = new RegExp("" + val + "=([^&?]*)", "ig");
            return ((uri.match(re)) ? (uri.match(re)[0].substr(val.length + 1)) : null);
        }

        var upload_callback = function () {
            var error = getParameter("error");
            error = parseInt(error)
            var dataObject;
            if (error == 0) {
                var url = getParameter("url");
                dataObject = { "error": error, "url": "https:" + url };
            } else {
                dataObject = {"error": error, "message": "图片上传失败"};
            }
            var data = JSON.stringify(dataObject)
            document.getElementsByTagName("body")[0].innerHTML = '<pre>' + data + '</pre>';
        }
    </script>
</head>

<body onload="upload_callback();">
</body>

</html>
